package org.ix.gateway.route.presentation.mapper;

import org.ix.gateway.route.presentation.entity.GatewayRouteEntity;
import org.ix.gateway.route.presentation.entity.GatewayRouteEntityExt;
import org.ix.gateway.route.presentation.condition.GatewayRouteSelectCondition;
import org.ix.gateway.route.presentation.condition.GatewayRouteUpdateCondition;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Collection;

/**
 * 网关路由数据访问
 *
 * @author 郗世豪（rarexixi@sina.com）
 */
@Mapper
public interface GatewayRouteMapper extends BaseMapper<GatewayRouteEntity, GatewayRouteEntityExt, GatewayRouteUpdateCondition, GatewayRouteSelectCondition> {

    /**
     * 根据路由id获取网关路由详情
     *
     * @param id 路由id
     * @return 网关路由详情
     * @author 郗世豪（rarexixi@sina.com）
     */
    GatewayRouteEntityExt detail(@Param("id") String id);

    /**
     * 批量添加网关路由
     *
     * @param list 网关路由列表
     * @return 受影响的行数
     * @author 郗世豪（rarexixi@sina.com）
     */
    int batchInsert(@Param("list") Collection<GatewayRouteEntity> list);
}
